﻿<UserControl x:Class="CasinoApp.Views.SlotMachineBarControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="450" d:DesignWidth="173">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="SlotAnimations">
                <VisualState x:Name="SpinningOn">
                    <Storyboard SpeedRatio="8" AutoReverse="False" RepeatBehavior="Forever" >
                        <!--Symbol Streifen 1 animieren-->
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="stripeImage1" RepeatBehavior="1x">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="900"/>
                        </DoubleAnimationUsingKeyFrames>
                        <!--Symbol Streifen 2 animieren-->
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="stripeImage2" RepeatBehavior="1x">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="900"/>
                        </DoubleAnimationUsingKeyFrames>
                        <!--Resultat-Symbol ausblenden-->
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="resultImage">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="SpinningOff">
                    <Storyboard>
                        <!--Symbol Streifen 1 ausblenden-->
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="stripeImage1">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <!--Symbol Streifen 2 ausblenden-->
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="stripeImage2">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <!--Resultats-Image wackeln-->
                        <DoubleAnimationUsingKeyFrames SpeedRatio="5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="resultImage">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="6"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="-6"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2.2" Value="3"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2.4" Value="0"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2.6" Value="-2.997"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2.8" Value="0.002"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:3.0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <!--Anmierter Symbol Streifen 1-->
        <Image x:Name="stripeImage1" Source="../_Images/SlotMachine/SymbolStripe.png" Margin="0,-1350,0,0" Width="173" Height="900" VerticalAlignment="Top" HorizontalAlignment="Left"  >
            <Image.RenderTransform>
                <CompositeTransform/>
            </Image.RenderTransform>
        </Image>
        <!--Anmierter Symbol Streifen 2-->
        <Image x:Name="stripeImage2" Source="../_Images/SlotMachine/SymbolStripe.png" Margin="0,-450,0,0" Width="173" Height="900" VerticalAlignment="Top" HorizontalAlignment="Left"  >
            <Image.RenderTransform>
                <CompositeTransform/>
            </Image.RenderTransform>
        </Image>

        <!--Resulat-Symbol-->
        <Image x:Name="resultImage" Width="173" Height="450" VerticalAlignment="Top" HorizontalAlignment="Left" d:IsHidden="True" >
            <Image.RenderTransform>
                <CompositeTransform/>
            </Image.RenderTransform>
        </Image>
       
    </Grid>
</UserControl>
